<?php
namespace Ucer\Hasher;

class Md5Hasher
{
    /**
   * [make description]
   * @param  [type] $value   [description]
   * @param  array  $options [description]
   * @return [string]          [description]
   */
    public function make($value, array $options = [])
    {
        $salt = isset($options['salt'])?$options['salt']:'';
        return hash('md5', $value . $salt);
    }
    /**
     * [check description]
     * @param  [type] $value     [description]
     * @param  [type] $hashvalue [description]
     * @param  array  $options   [description]
     * @return [bool]            [description]
     */
    public function check($value, $hashvalue, array $options=[])
    {
        $salt = isset($options['salt'])?$options['salt']:'';
        return hash('md5', $value.$salt) === $hashvalue;
    }
}
